package com.group525.cloudef.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.group525.cloudef.entity.user.UHazard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author group525
 * @since 2023-05-17
 */
@Mapper
public interface UHazardMapper extends BaseMapper<UHazard> {

    //获取危急值信息
    @Select("select * from u_hazard")
    List<UHazard> getHazard();
    @Select("select name from d_user where id=#{id}")
    String getDocName(Long id);
    @Select("select name from u_user where id=#{id}")
    String getUserName(Long id);
    @Select("select gender from u_user where id=#{id}")
    String getUserGender(Long id);
    @Select("select age from u_user where id=#{id}")
    String getUserAge(Long id);

    //获取病例数和危急值数
    @Select("select count(*) from u_user")
    Integer getUserCount();
    @Select("select count(*) from u_hazard")
    Integer getHazardCount();

    @Select("select count(*) from u_infectious")
    Integer getInfectCount();
    @Select("select count(*) from u_infectious where disease_name='脊髓灰质炎'")
    Integer getJiHui();
    @Select("select count(*) from u_infectious where disease_name='肺结核'")
    Integer getFeiJieHe();
    @Select("select count(*) from u_infectious where disease_name='肺炎'")
    Integer getFeiYan();
    @Select("select count(*) from u_infectious where disease_name='百日咳'")
    Integer getBaiRiKe();
    @Select("select count(*) from u_infectious where disease_name='流行性乙型脑炎'")
    Integer getLiuNao();
}
